<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateIDETypeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ide_type', function (Blueprint $table) {
            $table->id();
            $table->string("IDE_Name");
            $table->string("IDE_Version");
            $table->string("IDE_Path");
            $table->bigInteger("item_id")->unsigned();
            $table->engine = "InnoDB";
        });
        Schema::table('ide_type',function (Blueprint $table){
            $table->foreign('item_id')->on('store_items')->references('id')->onDelete("cascade");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ide_type');
    }
}
